home *** CD-ROM | disk | FTP | other *** search
- Path: colossus.holonet.net!brranch!robert.threet
- From: robert.threet@br-ranch.org (Robert Threet)
- Newsgroups: comp.lang.c
- Subject: GNU C & pow(x,y)
- Date: Sat, 17 Feb 1996 03:02:00 GMT
- Message-ID: <9602162139036@br-ranch.org>
- Organization: Bufkin Ridge Ranch 1-812-838-9053
- Distribution: world
-
- I'm just learning C. I thought I'd start by converting
- my old QuickBASIC programs into C. I've hit a snag:
- I'm trying to convert a mortgage payment calculator that
- uses an exponent (a negative exponent). I've tried
- using 1/x instead of the negative exponent, but I don't
- think that's my problem. Here's the line:
-
- paymnt = pow((amt * mo_rate)/(1-(1 + mo_rate)), (-mo_rate));
-
- All variables are defined as floating point. I've included
- "math.h" and I use this to compile:
-
- gcc -o mort mort.c -lm
-
- Despite this I keep getting the error: "undefined ref. to pow".
-
- Can someone...
-
- A) Tell me what I'm doing wrong... or
- B) Give me a better formula for calculating a mortgage payment?
-
- TIA
- ...
- * ATP/Linux 1.42 * Exercise daily. Eat wisely. Die anyway.
-